const { defineConfig } = require('@vue/cli-service')

//复制配@的方法

const path = require('path')
function resolve(dir) {
  return path.join(__dirname, dir)
}


module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,//关闭语法检查
  configureWebpack: {
    resolve: {
      alias: {
        '@': resolve('src'),
      },
    },
  },
  devServer: {
    proxy: {
      '/api': {
        target: 'http://sph-h5-api.atguigu.cn',
        ws: true,
        changeOrigin: true,
        // pathRewrite: { '^/api': '' },
        // pathRewrite: { '^/api/item': '/item' }
      },
      '/wy': {  //向网易服务器请求，前缀加这个
        target: 'https://m.you.163.com',
        pathRewrite: { '^/wy': '' },

      }
    }
      
  }
})
